package com.itts.hk.theard.Demo;

import java.util.List;
import java.util.concurrent.Callable;
/**
 * ListThread线程类, 继承Callable接口
 * @author ouyangjun
 */
public class ListThread implements Callable<String> {
    private List<Object> list;

    /** 初始化list, 传值可各种各 样*/
    public ListThread(List<Object> list) {
        this.list = list;
    }

    /** 返回字符串,也可以把对象转化成json字符串返回 */
    public String call() throws Exception {
        // 做具体的业务逻辑
        for (Object obj : list) {
            System.out.println("ListThread==>list: " + obj);
        }
        return "ListThread OK!";
    }
}
